<script type="text/javascript">

RED.nodes.registerType('xiaoai-ai-service', {
  category: '小米',
  color: '#7ac6cb',
  paletteLabel: '小爱ai service',
  label () {
    return this.name || '小爱ai service'
  },
  defaults: {
    name: {
      value: ''
    },
    xiaoai: {
      value: '',
      type: 'xiaoai-tts-configurator'
    },
    message: {
      value: ''
    },
    tts: {
      value: false
    },
    tts_play: {
      value: false
    },
    device: {
      value: ''
    }

  },
  inputs: 1,
  outputs: 2,
  icon: 'ai.svg'
})

RED.nodes.registerType('xiaoai-nlp-result', {
  category: '小米',
  color: '#7ac6cb',
  paletteLabel: 'nlp结果',
  label () {
    return this.name || 'nlp结果'
  },
  defaults: {
    name: {
      value: ''
    },
    xiaoai: {
      value: '',
      type: 'xiaoai-tts-configurator'
    },
    device: {
      value: ''
    }

  },
  inputs: 1,
  outputs: 2,
  icon: 'nlp.svg'
})

</script>

    <script type="text/x-red" data-template-name="xiaoai-ai-service">
          <div class="form-row">
            <label for="node-input-xiaoai"><i class="icon-tag"></i>配置</label>
            <input type="text" id="node-input-xiaoai">
          </div>
          <div class="form-row">
            <label for="node-input-name"><i class="icon-tag"></i>名称</label>
            <input type="text" id="node-input-name">
          </div>
          <div class="form-row">
            <label for="node-input-message"><i class="icon-tag"></i>指令</label>
            <input type="text" id="node-input-message" placeholder="ai 指令消息">
          </div>

          <div class="form-row">
            <label for="node-input-tts"><i class="icon-tag"></i>播报结果</label>
            <input type="checkbox" id="node-input-tts" >
          </div>

          <div class="form-row">
            <label for="node-input-tts_play"><i class="icon-tag"></i>未知</label>
            <input type="checkbox" id="node-input-tts_play" >
          </div>

          <div class="form-row">
            <label for="node-input-device"><i class="icon-tag"></i>默认设备</label>
            <input type="text" id="node-input-device" placeholder="默认设备id">
          </div>

          <div class="form-row">
            <label style="width: 100%;text-align: right;padding-right: 34px;box-sizing: border-box;" >
              <a href="https://bbs.iobroker.cn" target="_blank">此节点由 (ioBroker中国|智能家居)提供</a>
            </label>
          </div>
    </script>
    <script type="text/x-red" data-help-name="xiaoai-ai-service">
      <p>小爱音箱 ai service,节点里面实现了默认的队列信息,所以如果在多个NodeRed界面使用,请使用link节点连接到统一的ai-service节点</p>
      <p> 当前节点可以直接控制米家里面所有的设备，或用于查询一些指令： 例如，今天天气怎么样？或 打开厨房的灯</p>
      <p>不然可能引起播报信息错乱等异常信息</p>
      <h3>输入</h3>
      <dl class="message-properties">
          <dt>payload
              <span class="property-type">string</span>
          </dt>
          <dd>ai 控制指令</dd>
          <dt>device
            <span class="property-type">string</span>
          </dt>
          <dd>设备唯一标识,用户指定tts设备</dd>
          <dt>tts_play
            <span class="property-type">boolean</span>
          </dt>
          <dd>未知，默认否</dd>
          <dt>tts
            <span class="property-type">boolean</span>
          </dt>
          <dd>是否tts结果，默认否</dd>

      </dl>
      <h3>输出</h3>
      <p>当发生错误的时候，将会从输出2里面输出msg.payload = {} ,如果需要请做相关业务处理</p>
      <p>其余信息查看输出</p>

    </script>

    <script type="text/x-red" data-template-name="xiaoai-nlp-result">
        <div class="form-row">
          <label for="node-input-xiaoai"><i class="icon-tag"></i>配置</label>
          <input type="text" id="node-input-xiaoai">
        </div>
        <div class="form-row">
          <label for="node-input-name"><i class="icon-tag"></i>名称</label>
          <input type="text" id="node-input-name">
        </div>

        <div class="form-row">
          <label for="node-input-device"><i class="icon-tag"></i>默认设备</label>
          <input type="text" id="node-input-device" placeholder="默认设备id">
        </div>

        <div class="form-row">
          <label style="width: 100%;text-align: right;padding-right: 34px;box-sizing: border-box;" >
            <a href="https://bbs.iobroker.cn" target="_blank">此节点由 (ioBroker中国|智能家居)提供</a>
          </label>
        </div>
    </script>
    <script type="text/x-red" data-help-name="xiaoai-nlp-result">

      <p>nlp 结果查看</p>
      <h3>输入</h3>
      <dl class="message-properties">
          <dt>device
            <span class="property-type">string</span>
          </dt>
          <dd>设备唯一标识,用户指定tts设备</dd>

      </dl>
      <h3>输出</h3>
      <p>当发生错误的时候，将会从输出2里面输出msg.payload = {} ,如果需要请做相关业务处理</p>
      <p>其余信息查看输出</p>

    </script>

